"""
@Time: 2020/12/6 下午 5:15
@Author: jinzhuan
@File: pipeline_test.py
@Desc: 
"""
import sys
sys.path.append('/data/zhuoran/code/cognlp')
import torch
from cognlp import *

torch.cuda.set_device(4)
device = torch.device("cuda")
pipeline = Pipeline(device=device, device_ids=[5, 6], max_seq_length=256)
import time
start = time.time()
print(pipeline.predict_linking("The Austroasiatic languages, in recent classifications synonymous with Mon–Khmer, are a large language family of continental Southeast Asia, also scattered throughout India, Bangladesh, Nepal and the southern border of China."))
end = time.time()
print(end - start)
# print(toolkit.predict("The Austroasiatic languages, in recent classifications synonymous with Mon–Khmer, are a large language family of continental Southeast Asia, also scattered throughout India, Bangladesh, Nepal and the southern border of China."))



